package com.example.samui.case03_16110100414;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    private Button button_login;
    private EditText et_username,et_password;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        button_login = findViewById(R.id.button_login);
        et_username = findViewById(R.id.et_username);
        et_password = findViewById(R.id.et_password);


        button_login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent = new Intent(MainActivity.this, WelcomeActivity.class);

                intent.putExtra("username",
                            et_username.getText().toString());
                intent.putExtra("password",
                            et_password.getText().toString());
                startActivity(intent);

            }
        });

    }
}
